package com.twb.core.swagger2;

import javax.annotation.PostConstruct;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;


@Component
@ConfigurationProperties(prefix = "twb.swagger")
public class SwaggerConfigProperties {
	private static final Logger logger = LoggerFactory.getLogger(SwaggerConfigProperties.class);
	private boolean enabled = false;
	private String title = "twb-starter-core";
	private String description = "twb核心模块";
	private String scanBasePackage = "com.twb";
	private String license = "Tware License Version 1.0.0";
	private String licenseUrl = "http://www.Tware.com";
	private String version = "0.0.1-SNAPSHOT";
	private String contactName = "Tware";
	private String contactUrl = "http://www.Tware.com";
	private String contactEmail = "dushunya@163.com";
	private String authClient = "";

	public SwaggerConfigProperties() {
	}

	public boolean isEnabled() {
		return this.enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getScanBasePackage() {
		return this.scanBasePackage;
	}

	public void setScanBasePackage(String scanBasePackage) {
		this.scanBasePackage = scanBasePackage;
	}

	public String getVersion() {
		return this.version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	public String getAuthClient() {
		return this.authClient;
	}

	public void setAuthClient(String authClient) {
		this.authClient = authClient;
	}

	public String getLicense() {
		return license;
	}

	public void setLicense(String license) {
		this.license = license;
	}

	public String getLicenseUrl() {
		return licenseUrl;
	}

	public void setLicenseUrl(String licenseUrl) {
		this.licenseUrl = licenseUrl;
	}

	public String getContactName() {
		return contactName;
	}

	public void setContactName(String contactName) {
		this.contactName = contactName;
	}

	public String getContactUrl() {
		return contactUrl;
	}

	public void setContactUrl(String contactUrl) {
		this.contactUrl = contactUrl;
	}

	public String getContactEmail() {
		return contactEmail;
	}

	public void setContactEmail(String contactEmail) {
		this.contactEmail = contactEmail;
	}

	public String toString() {
		return "SwaggerConfigProperties{enabled=" + this.enabled + ", title='" + this.title + '\'' + ", description='"
				+ this.description + '\'' + ", scanBasePackage='" + this.scanBasePackage + '\'' + ", version='"
				+ this.version + '\'' + ", authClient='" + this.authClient + '\'' + '}';
	}

	@PostConstruct
	public void init() {
		logger.info("swagger is enabled : {}", this.enabled);
	}
}